package com.liyunc.demo.exception;

import com.liyunc.demo.enums.ResultCode;

/**
 * 自定义数据匹配异常类.
 */
public class DataMatchException extends RuntimeException {
    private String code;//码
    private String message;//信息

    public DataMatchException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public DataMatchException(ResultCode resultCode) {
        this.code = String.valueOf(resultCode.getCode());
        this.message = resultCode.getMessage();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
